package com.dhcc.core.modules.system.dao;

import java.util.List;
import java.util.Map;

import com.dhcc.core.modules.system.entity.PanAttachment;
import org.apache.ibatis.annotations.Param;
import com.dhcc.core.framework.base.mapper.BaseMapper;
import com.baomidou.mybatisplus.plugins.Page;

/**
 * 
 * 
 * @ClassName: PanAttachmentMapper
 * @Description: TODO
 * @author mk
 * @date 2018-08-31 10:07:21
 */
public interface PanAttachmentMapper extends BaseMapper<PanAttachment> {
    List<PanAttachment> list(@Param("page") Page<PanAttachment> page, @Param("map") Map<String, Object> map);

    /**
     * 判断用户拥有那些文件
     * @param userId
     * @param attachmentId
     * @return
     */
    List<PanAttachment> hasAttachmentByUserId(@Param("userId") Long userId, @Param("attachmentId") List<Long> attachmentId);

    /**
     * 批量更新引用数
     * @param quote 正负代表引用数加减
     * @param attachmentId
     */
    void updataQuoteByListId(@Param("quote")int quote,@Param("attachmentId") List<Long> attachmentId);
}
